package utils;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;

/**
 * Created by Lenovo on 2017/3/16.
 */
public class Log {

    private  static BufferedWriter writer = null;

    static {
        try {
            writer = new BufferedWriter(new FileWriter("D:/log.txt"));
        } catch (IOException e) {
            e.printStackTrace();
        }
    }


    public static void log(String info) {
        try {
            writer.write(info);
            writer.newLine();
            writer.flush();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public static void close() {
        try {
            writer.flush();
            writer.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
